package oc.tm.sg.demo.consumer;

import java.util.List;

import oc.tm.sg.core.rpc.consumer.RpcConsumerFactory;
import oc.tm.sg.demo.api.DemoAPI;
import oc.tm.sg.demo.api.po.User;

import com.alibaba.fastjson.JSON;

public class DemoRpcConsumer {
	
	public static void main(String[] args) throws Exception {
		RpcConsumerFactory factory=RpcConsumerFactory.INSTANCE;
		factory.start();
		
		DemoAPI hello=factory.getService(DemoAPI.class);
		
		int i=0;
		while (i<300) {
			List<User> list=hello.getUsers(new User(1023l, "zhangsan", 34));
			System.out.println(JSON.toJSON(list));
			Thread.sleep(1000);
		}
		
		factory.destroy();
	}
	
}
